#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <kvs.h>
#define SAMPLE_CNT 5

char* keys[SAMPLE_CNT]={"aa", "huhu", "hehehe", "hihihi","hub"};
char* values[SAMPLE_CNT]={"bbbb","aaaa","yyyy","xxxx","zzzz"};

int main()
{
	char config_file[512];
	char buf[1024];
	int i;

	printf ("config_file:");
	scanf ("%s", config_file);

	kv_init(config_file);

	for (i=0; i<SAMPLE_CNT; i++)
	{
		kv_put( keys[i], strlen(keys[i]), values[i], strlen(values[i]) );
	}

	for (i=0; i<SAMPLE_CNT; i++) 
	{
		kv_get( keys[i], strlen(keys[i]), buf, 1024 );
		printf ("GET:%s  \t:\t%s\n",keys[i], buf);
	}

	for (i=0; i<SAMPLE_CNT; i++)
	{
		kv_delete( keys[i], strlen(keys[i]));
	}

	kv_exit();

	return 0;
}


